<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>

<head>
    {include file="public/header"/}
    <link rel="stylesheet" type="text/css" href="/static/cms/css/skin_content.css" />
    <link rel="stylesheet" href="/static/cms/css/layui.css" media="all">
    <link rel="stylesheet" href="/static/cms/css/admin.css" media="all">
</head>

<body style="">
    {include file="public/channel"/}
    <div>
        <!--banner导航-->
        <div class="dt column" id="dt" name="导航" runat="server">
            <div class="portlet" id="7b3272aca8534583a9927f4a9ee8216b" pagemoduleid="7b98bd0ee60b4b75a827f2870a09975e">
                <div align="left" class="portlet-header">
                    <span id="menu">
                    </span>
                    <div id="submenu7b3272aca8534583a9927f4a9ee8216b" class="shadow dn">
                        <ul class="float_list_ul">
                        </ul>
                    </div>
                </div>
                <div>
                    <ul class="twoBanner" opentype="page">
                        <li class=""> <img src="{$banner}" border="0" /> </li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
    <div class="comBox">
        <div class="comwidth ">
            <!--内容区-->
            <div class="clearfix content_nr">
                <div class="conLeft lt column" name="左侧" id="conLeft" runat="server">
                    {include file="public/left_nav"/}
                </div>
                <div class="dqwz" id="weiZi">
                    {include file="public/crumb"/}
                </div>
                <div class="conRig rt column" name="右侧" id="conse" runat="server">
                    <div class="portlet" id="a2571413ac154cc59d923b91352724da" pagemoduleid="8edc612664f94ca7a77948c91a86e25a">
                        <div>
                            <p class="kp-title">在线留言</p> 
                            <div class="layui-fluid" id="LAY-app-message" style="box-shadow: 2px 0 20px #e3e3e3;">
                                <div class="layui-form" wid100 lay-filter="" style="margin:50px 50px 50px 0px">
                                                    <div class="layui-form-item">
                                                        <div class="layui-input-block">
                                                            <input type="text" name="title" value="" class="layui-input" placeholder="标题" lay-verify="required">
                                                        </div>
                                                    </div>
                                                    <div class="layui-form-item layui-form-text">
                                                        <div class="layui-input-block">
                                                            <textarea name="content" class="layui-textarea" placeholder="内容" lay-verify="required"></textarea>
                                                        </div>
                                                    </div>
                                                    <div class="layui-form-item">
                                                        <div class="layui-input-block">
                                                            <input type="text" name="username" value="" class="layui-input" placeholder="姓名" lay-verify="required">
                                                        </div>
                                                    </div>
                                                    <div class="layui-form-item">
                                                        <div class="layui-input-block">
                                                            <input type="text" name="telphone" value="" class="layui-input" placeholder="电话" lay-verify="required">
                                                        </div>
                                                    </div>
                                                    <div class="layui-form-item">
                                                        <div class="layui-input-block">
                                                            <input type="text" name="uemail" value="" class="layui-input" placeholder="邮箱">
                                                        </div>
                                                    </div>
                                                    <div class="layui-form-item">
                                                        <div class="layui-input-inline">
                                                            <input type="text" name="vercode" value="" class="layui-input" placeholder="验证码" lay-verify="required">
                                                        </div>
                                                        <div class="layui-form-mid layui-word-aux vercode-div" style="padding-top: 0px !important;">
                                                            <img src="{:captcha_src()}" class="layadmin-user-login-codeimg" id="change-vercode" style="height:38px;">
                                                        </div>
                                                    </div>
                                                    <div class="layui-form-item">
                                                        <div class="layui-input-block">
                                                            <button class="layui-btn" lay-submit lay-filter="save_about">提交</button>
                                                            <button type="reset" class="layui-btn layui-btn-primary" lay-submit >重置</button>
                                                        </div>
                                                    </div>
                                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <!--内容区end-->
        </div>
    </div>
    {include file="public/footer"/}
    <script>
    function Out(val) {
        document.getElementById("FORM").action = val;
        document.getElementById("FORM").submit();
    }
    </script>
    <script type="text/javascript">
    document.write(unescape("%3Cspan id='cnzz_stat_icon_1279165154'%3E%3C/span%3E%3Cscript src='https://s4.cnzz.com/z_stat.php%3Fid%3D1279165154%26show%3Dpic1' type='text/javascript'%3E%3C/script%3E"));
    </script>
    <style>
    #cnzz_stat_icon_1279165154 {
        display: none;
    }
    </style>
<!--     <script>
    $('.leftList>ul>li').each(function(index, item) {
        $(item).attr('id', 'id-' + index);
    });
    $('.flList1>li').each(function(index, item) {
        $(item).attr('id', 'id_' + index);
    });
    </script> -->
    <script src="/static/layadmin/layui/layui.js"></script>  
  <script>
  layui.config({
    base: '/static/layadmin/' //静态资源所在路径
  }).extend({
    index: 'lib/index' //主入口模块
  }).use(['index', 'user','form'], function(){
    var $ = layui.$
    // ,setter = layui.setter
    // ,admin = layui.admin
    ,form = layui.form;
    // ,router = layui.router()
    // ,search = router.search;

    // form.render();

    //提交
    form.on('submit(save_about)', function(obj){
      var field = obj.field; //获取提交的字段
      var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引  
      // layer.msg('表单已提交');
      // console.log(field);
      //提交 Ajax 成功后，关闭当前弹层并重载表格
      $.post('/index/message/domessage', { title: field.title, content: field.content,username: field.username,telphone: field.telphone,uemail: field.uemail, vercode: field.vercode}, function(res) {
          res = $.parseJSON(res);
          console.log(res);
          if (res.code == 200) {
              layer.msg(res.msg, {
                  icon: 1,
                  time: 3000 //2秒关闭（如果不配置，默认是3秒）
              }, function() {    
                 // location.href = '/admin'; //后台主页
              });
          } else {
              layer.msg(res.msg, { icon: 2, time: 3000 });
          }
      });
    });

    //更换图形验证码
    $('body').on('click', '#change-vercode', function(){
      var othis = $(this);
      this.src = '{:captcha_src()}?t='+ new Date().getTime()
    });
    
    //实际使用时记得删除该代码
    // layer.msg('为了方便演示，用户名密码可随意输入', {
    //   offset: '15px'
    //   ,icon: 1
    // });
    
  });
  </script>
</body>

</html>